/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mowa.biblioteca.controller;

import com.mowa.biblioteca.model.Categoria;
import com.mowa.biblioteca.service.CategoriaService;


import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

//@Controller
public class CategoriaController {
/*
    private CategoriaService categoriaService;

    @Autowired
    public  CategoriaController(CategoriaService categoriaService){
        this.categoriaService = categoriaService;
    }

    @RequestMapping(value="/catalogo.htm", method=RequestMethod.GET)
    public ModelAndView listaCategoria( ){

        ModelAndView mav = new ModelAndView("catalogo");

        List<Categoria> categorias = categoriaService.obtenerListaCategoria();
        mav.addObject("listaCategoria", categorias);
        return mav;
    }
    
    @ModelAttribute("categorias")
    public   List<Categoria> listarCategoria() {

             List<Categoria> categorias = categoriaService.obtenerListaCategoria();
            return categorias;
    }
*/
}
